
create  table jms_dm.dm_all_transfer_count_bak_dt (

   date_time date comment '签收日期' ,
   taking_code varchar(200) comment '揽收网点',
   taking_agent_code varchar(200) comment '代理区编码',
   taking_name varchar(200) comment '揽收网点' ,
   taking_agent_name varchar(200) comment '代理区名称,',
   taking_provider_id varchar(200) comment '省份id',
   taking_provider_desc varchar(200) comment '省份',
   taking_city_id varchar(200) comment '城市id',
   taking_city_desc varchar(200) comment '城市',
   first_center_network_code varchar(200) comment '始发中心',
   first_center_network_name varchar(200) comment '始发中心' ,
   front_number bigint comment '件量',
   front_plan_zz   bigint comment '规划中转次数',
   front_actual_zz bigint comment '实际中转次数',
   front_agent_in bigint comment '代理区内中转次数',
   front_agent_out bigint comment '代理区外中转次数',
   front_reback bigint comment '退件件量',
   front_reback_zz bigint comment '退件中转次数',
   front_rational bigint comment '不合理件量',
   front_rational_zz bigint comment '不合理中转次数',
   front_proble bigint comment '问题件件量',
   front_proble_zz bigint comment '问题件中转次数',
   front_is_wrong bigint comment '网点错发件件量',
   front_is_wrong_zz bigint comment '网点错发件中转次数',
   front_bak_route bigint comment '备用路由件量',
   front_bak_route_zz bigint comment '备用路由中转次数'
)
ENGINE=OLAP
DUPLICATE KEY(date_time,taking_code,taking_agent_code)
comment '全程中转次数汇总表_网点'
PARTITION BY RANGE (date_time) (
   START ("2023-06-01") END ("2023-07-01") EVERY (INTERVAL 1 day))
 DISTRIBUTED BY HASH(taking_code) BUCKETS 2
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-1000",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "2",
"in_memory" = "false",
"storage_format" = "V2"
);